package com.icart.entities;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "bi_msg", schema = "ams", catalog = "")
public class BiMsgEntity {
    private long msgid;
    private String sourceobj;
    private String sourceobjid;
    private String msgtype;
    private String msgtitle;
    private String msg;
    private String obj;
    private String objid;
    private String sendtype;
    private String sendtypeid;
    private Integer sendstat;
    private Integer readstat;
    private Timestamp createtime;
    private Timestamp sendtime;
    private String tourl;

    @Id
    @Column(name = "msgid")
    public long getMsgid() {
        return msgid;
    }

    public void setMsgid(long msgid) {
        this.msgid = msgid;
    }

    @Basic
    @Column(name = "sourceobj")
    public String getSourceobj() {
        return sourceobj;
    }

    public void setSourceobj(String sourceobj) {
        this.sourceobj = sourceobj;
    }

    @Basic
    @Column(name = "sourceobjid")
    public String getSourceobjid() {
        return sourceobjid;
    }

    public void setSourceobjid(String sourceobjid) {
        this.sourceobjid = sourceobjid;
    }

    @Basic
    @Column(name = "msgtype")
    public String getMsgtype() {
        return msgtype;
    }

    public void setMsgtype(String msgtype) {
        this.msgtype = msgtype;
    }

    @Basic
    @Column(name = "msgtitle")
    public String getMsgtitle() {
        return msgtitle;
    }

    public void setMsgtitle(String msgtitle) {
        this.msgtitle = msgtitle;
    }

    @Basic
    @Column(name = "msg")
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Basic
    @Column(name = "obj")
    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    @Basic
    @Column(name = "objid")
    public String getObjid() {
        return objid;
    }

    public void setObjid(String objid) {
        this.objid = objid;
    }

    @Basic
    @Column(name = "sendtype")
    public String getSendtype() {
        return sendtype;
    }

    public void setSendtype(String sendtype) {
        this.sendtype = sendtype;
    }

    @Basic
    @Column(name = "sendtypeid")
    public String getSendtypeid() {
        return sendtypeid;
    }

    public void setSendtypeid(String sendtypeid) {
        this.sendtypeid = sendtypeid;
    }

    @Basic
    @Column(name = "sendstat")
    public Integer getSendstat() {
        return sendstat;
    }

    public void setSendstat(Integer sendstat) {
        this.sendstat = sendstat;
    }

    @Basic
    @Column(name = "readstat")
    public Integer getReadstat() {
        return readstat;
    }

    public void setReadstat(Integer readstat) {
        this.readstat = readstat;
    }

    @Basic
    @Column(name = "createtime")
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "sendtime")
    public Timestamp getSendtime() {
        return sendtime;
    }

    public void setSendtime(Timestamp sendtime) {
        this.sendtime = sendtime;
    }

    @Basic
    @Column(name = "tourl")
    public String getTourl() {
        return tourl;
    }

    public void setTourl(String tourl) {
        this.tourl = tourl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BiMsgEntity that = (BiMsgEntity) o;

        if (msgid != that.msgid) return false;
        if (sourceobj != null ? !sourceobj.equals(that.sourceobj) : that.sourceobj != null) return false;
        if (sourceobjid != null ? !sourceobjid.equals(that.sourceobjid) : that.sourceobjid != null) return false;
        if (msgtype != null ? !msgtype.equals(that.msgtype) : that.msgtype != null) return false;
        if (msgtitle != null ? !msgtitle.equals(that.msgtitle) : that.msgtitle != null) return false;
        if (msg != null ? !msg.equals(that.msg) : that.msg != null) return false;
        if (obj != null ? !obj.equals(that.obj) : that.obj != null) return false;
        if (objid != null ? !objid.equals(that.objid) : that.objid != null) return false;
        if (sendtype != null ? !sendtype.equals(that.sendtype) : that.sendtype != null) return false;
        if (sendtypeid != null ? !sendtypeid.equals(that.sendtypeid) : that.sendtypeid != null) return false;
        if (sendstat != null ? !sendstat.equals(that.sendstat) : that.sendstat != null) return false;
        if (readstat != null ? !readstat.equals(that.readstat) : that.readstat != null) return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (sendtime != null ? !sendtime.equals(that.sendtime) : that.sendtime != null) return false;
        if (tourl != null ? !tourl.equals(that.tourl) : that.tourl != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (msgid ^ (msgid >>> 32));
        result = 31 * result + (sourceobj != null ? sourceobj.hashCode() : 0);
        result = 31 * result + (sourceobjid != null ? sourceobjid.hashCode() : 0);
        result = 31 * result + (msgtype != null ? msgtype.hashCode() : 0);
        result = 31 * result + (msgtitle != null ? msgtitle.hashCode() : 0);
        result = 31 * result + (msg != null ? msg.hashCode() : 0);
        result = 31 * result + (obj != null ? obj.hashCode() : 0);
        result = 31 * result + (objid != null ? objid.hashCode() : 0);
        result = 31 * result + (sendtype != null ? sendtype.hashCode() : 0);
        result = 31 * result + (sendtypeid != null ? sendtypeid.hashCode() : 0);
        result = 31 * result + (sendstat != null ? sendstat.hashCode() : 0);
        result = 31 * result + (readstat != null ? readstat.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (sendtime != null ? sendtime.hashCode() : 0);
        result = 31 * result + (tourl != null ? tourl.hashCode() : 0);
        return result;
    }
}
